package com.qingxin.wuye.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

/**
 * 车位区域
 * WyCarportArea entity. 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "wy_carport_area")
public class WyCarportArea extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 3932469811288841028L;
	// Fields

	private String areaid;
	private WyGarden wyGarden;
	private String areaCode;
	private String areaName;
	private String remark;
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date updateTime;
	private Set<WyCarport> wyCarports = new HashSet<WyCarport>(0);

	private String gardenName;
	
	// Constructors

	/** default constructor */
	public WyCarportArea() {
	}
	
	

	public WyCarportArea(String areaid, String areaName) {
		this.areaid = areaid;
		this.areaName = areaName;
	}



	public WyCarportArea(String areaid, String areaCode, String areaName,
			String remark, String gardenName) {
		this.areaid = areaid;
		this.areaCode = areaCode;
		this.areaName = areaName;
		this.remark = remark;
		this.gardenName = gardenName;
	}


	/** full constructor */
	public WyCarportArea(WyGarden wyGarden, String areaCode, String areaName,
			String remark, String createBy, Date createTime,
			String updateBy, Date updateTime, Set<WyCarport> wyCarports) {
		this.wyGarden = wyGarden;
		this.areaCode = areaCode;
		this.areaName = areaName;
		this.remark = remark;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.wyCarports = wyCarports;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "areaid", unique = true, nullable = false, length = 32)
	public String getAreaid() {
		return this.areaid;
	}

	public void setAreaid(String areaid) {
		this.areaid = areaid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "gardenid")
	@JsonIgnore
	public WyGarden getWyGarden() {
		return this.wyGarden;
	}

	public void setWyGarden(WyGarden wyGarden) {
		this.wyGarden = wyGarden;
	}

	@Column(name = "area_code", length = 50)
	public String getAreaCode() {
		return this.areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	@Column(name = "area_name", length = 50)
	public String getAreaName() {
		return this.areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	@Column(name = "remark", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_by", length = 50)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_by", length = 50)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "wyCarportArea")
	@JsonIgnore
	public Set<WyCarport> getWyCarports() {
		return this.wyCarports;
	}

	public void setWyCarports(Set<WyCarport> wyCarports) {
		this.wyCarports = wyCarports;
	}
	
	
	@Transient
	public String getGardenName() {
		return gardenName;
	}

	public void setGardenName(String gardenName) {
		this.gardenName = gardenName;
	}
	

}